<template>
  <div class="reportFormPage">
    <!--    <topOperation/>-->
    <div id="domid">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span>&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span>&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">沥青与粗集料的黏附性试验检测记录表</div>
        <div class="codeText">
          <tr>
            JGLQ10009
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="threeItem1" style="width: 90px">检测单位名称：</div>
        <div class="threeItem2">
          <span>{{ form.jiancdwmc }}</span>
        </div>
        <div class="threeItem1" style="width: 65px">记录编号：</div>
        <div class="threeItem2">
          <el-input type="text" v-model="form.jilbh" class="height100 bg-white" />
        </div>
      </div>
      <!-- .........................1111111111111111111111111111111......................................................... -->
      <table border="1" height="220px" bordercolor="#000000" cellpadding="2" cellspacing="0" align="center">
        <tbody>
          <tr>
            <td height="25" align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程名称</span>
            </td>
            <td width="35%" class="text-center">
              <span>{{ form.gongcmc }}</span>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程部位/用途</span>
            </td>
            <td width="35%" class="text-center">
              <span>{{ form.gongcbwyt }}</span>
            </td>
          </tr>
          <tr>
            <td height="50" align="center">样品信息</td>
            <td style="word-wrap: break-word; word-break: break-all;text-align:left" colspan="3">
              <span>样品名称：</span>
              <span>{{ form.yangpmc }}</span>
              <span>；样品编号：</span>
              <el-input type="text" v-model="form.yangpbh" style="width: 42%; height: auto" />
              <span>；样品数量：</span>
              <span>{{ form.yangpsl }}</span>
              <span>；样品状态：</span>
              <span>{{ form.yangpzt }}</span>
              <span>；来样时间：</span>
              <span>{{ form.yangpsj }}</span>
            </td>
          </tr>

          <tr>
            <td height="25" align="center" width="15%">
              <span style="width: 90px; display: inline-block">试验检测日期</span>
            </td>
             <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">试验条件</span>
            </td>
            <td width="35%">
              温度：
              <el-input type="number" v-model="form.shiytjwd" class="height100" style="width: 15%" />
              ℃；湿度：
              <el-input type="number" v-model="form.shiytjsd" class="height100" style="width: 15%" />
              %RH
            </td>
          </tr>

          <tr>
            <td height="25" align="center" width="15%">
              <span style="width: 90px; display: inline-block">检测依据</span>
            </td>
            <td width="35%">
              <el-input type="text" v-model="form.jiancyj" class="height100 width100" />
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">判定依据</span>
            </td>
            <td width="35%">
              <el-input type="text" v-model="form.pandyj" class="height100 width100" />
            </td>
          </tr>

          <tr>
            <td height="30" align="center">主要仪器设备<br />名称及编号</td>
            <td colspan="3">
              <el-input type="textarea" @dblclick.native="showBsInstrumentView" :rows="2" v-model="form.zhuyyqsbmcjbh"
                class="height100 width100 mark" readonly>
              </el-input>
              <!-- <el-button type="text" @click="showBsInstrumentView"><i class="el-icon-search"></i></el-button> -->
            </td>
          </tr>
        </tbody>
      </table>
      <!-- .........................取样地点......................................................... -->
      <table class="kind-table" border="1">
        <tbody>
          <tr>
            <td class="small">取样地点</td>
            <td class="large"><input type="text" v-model="form.quydd"/></td>
            <td class="small">沥青产地</td>
            <td class="large"><input type="text" v-model="form.liqcd"/></td>
            <td class="small">沥青种类及标号</td>
            <td class="large"><input type="text" v-model="form.liqzljbh"/></td>
          </tr>
          <tr>
            <td class="small">集料产地及名称</td>
            <td class="large"><input type="text" v-model="form.jilcdjmc"/></td>
            <td class="small">试验方法</td>
            <td class="large"><input type="text" v-model="form.shiyff"/></td>
            <td class="small">代表数量</td>
            <td class="large"><input type="text" v-model="form.daibsl"/></td>
          </tr>
        </tbody>
      </table>

      <!-- .................................表格操作............................................... -->
      <table class="custom-table">
        <tr>
          <td rowspan="2">编号</td>
          <td rowspan="2">集料粒径（mm）</td>
          <td rowspan="2">集料温度（℃）</td>
          <td rowspan="2">沥青温度（℃）</td>
          <td rowspan="2">集料在沥青中时间（s）</td>
          <td rowspan="2">裹覆沥青的集料冷却时间（min）</td>
          <td rowspan="2">浸煮时间（min）</td>
          <td colspan="2">试验后集料表面上沥青膜剥落情况（%）</td>
          <td rowspan="2">平均黏附性等级</td>
          <td rowspan="2">综合评定</td>
        </tr>
        <tr>
          <td>1号试验人员观察结果</td>
          <td>2号试验人员观察结果</td>
        </tr>
        <tr v-for="(row, index) in nfxRows" :key="index">
            <td>{{index + 1}}</td>
            <td><input type="text" v-model="row.jillj"></td>
            <td><input type="text" v-model="row.jilwd"></td>
            <td><input type="text" v-model="row.liqwd"></td>
            <td><input type="text" v-model="row.jilzlqzsj"></td>
            <td><input type="text" v-model="row.guoflqdjllqsj"></td>
            <td><input type="text" v-model="row.shiyrygcjg1"></td>
            <td><input type="text" v-model="row.shiyrygcjg2"></td>
            <td><input type="text" v-model="row.pingjnfxdj"></td>
            <template v-if="index === 0">
              <td :rowspan="5">
                <input type="text" v-model="form.zonghpd" disabled/>
              </td>
            </template>
          </tr>
    </table>
      <!-- .....................................................33333333333333333................................................... -->
      <table cellpadding="2" cellspacing="0" bordercolor="#000000" style="
          width: 100%;
          border-right: 2px solid black;
          border-left: 2px solid black;
          border-top-style: none;
          border-bottom: 2px solid black;
          border-collapse: collapse;
          margin: none;
        ">
        <tbody>
          <tr>
            <td height="30" align="center">附加声明：</td>
            <td colspan="3">
              <el-input type="textarea" :rows="2" v-model="form.fujsm" />
            </td>
          </tr>
        </tbody>
      </table>
      <!-- .................................44444444444............................................. -->
      <table border="0" cellpadding="0" cellspacing="0" align="center"
        style="width: 100%; border-collapse: collapse; height: 22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
  </div>
</template>

<script>
import { getLqYcjldnfxjlbBsInfo } from "@/api/report_lq/lqYcjldnfxjlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import decimal from "@/utils/big-decimal";

export default {
  name: "lqycjlnfxjlb",
  components: {
    BsInstrumentView,
    BaQjDetailView,
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => "",
    },

  },
  data () {
    return {
      params: {},
      query: {},
      // 表单参数
      form: {},
      nfxRows: [ //this.rows = responseData; // 将后端返回的数据赋值给 rows 数组
        { bianh: '1', jillj: '', jilwd: '', liqwd: '', jilzlqzsj: '', guoflqdjllqsj: '', jinzsj: '' , shiyrygcjg1: '' , shiyrygcjg2: '' , pingjnfxdj: '' , zonghpd: '' },
        { bianh: '2', jillj: '', jilwd: '', liqwd: '', jilzlqzsj: '', guoflqdjllqsj: '', jinzsj: '' , shiyrygcjg1: '' , shiyrygcjg2: '' , pingjnfxdj: '' , zonghpd: '' },
        { bianh: '3', jillj: '', jilwd: '', liqwd: '', jilzlqzsj: '', guoflqdjllqsj: '', jinzsj: '' , shiyrygcjg1: '' , shiyrygcjg2: '' , pingjnfxdj: '' , zonghpd: '' },
        { bianh: '4', jillj: '', jilwd: '', liqwd: '', jilzlqzsj: '', guoflqdjllqsj: '', jinzsj: '' , shiyrygcjg1: '' , shiyrygcjg2: '' , pingjnfxdj: '' , zonghpd: '' },
        { bianh: '5', jillj: '', jilwd: '', liqwd: '', jilzlqzsj: '', guoflqdjllqsj: '', jinzsj: '' , shiyrygcjg1: '' , shiyrygcjg2: '' , pingjnfxdj: '' , zonghpd: '' },
      ],
    };
  },
  created () {
    this.getInfo();
  },
  methods: {
    // 获取详情
    getInfo () {
      if (!this.excelId) {
        return;
      }
      getLqYcjldnfxjlbBsInfo(this.excelId).then((response) => {
        this.form = response.data;
        if (response.data.deList.length != 0) {
          this.nfxRows = response.data.deList
        }
      });
    },
        // 显示仪器列表
    showBsInstrumentView () {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument (info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
    },
  },
};
</script>

<style scoped lang="scss">
.custom-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid black;
}

.custom-table td {
  border: 1px solid black;
  text-align: center;
  height: 50px;
  width: 50px;
}

.custom-table input {
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
}
  .kind-table {
    width: 100%;
    border-collapse: collapse;
    border-top: none;
    border-bottom: none;
  }
  .kind-table td {
    border: 1px solid black;
    padding: 8px;
    height: 30px;
    text-align: center;
  }
  .kind-table input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: none;
    text-align: center;
    background-color: white; /* 设置input背景为白色 */
  }
</style>
